<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sys</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="../../css/bootstrap.min-lumen.css" rel="stylesheet">
    <link href="../../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="../../css/animate.css" rel="stylesheet">
    <link href="../../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../../css/plugins/pageMe/pageMe.css" rel="stylesheet"/>
    <link href="../../css/plugins/progressbar/mprogress.css" rel="stylesheet"/>
    <link href="../../css/plugins/progressbar/style.css" rel="stylesheet"/>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

</head>

<body class="gray-bg">
<div id="body">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>客户管理模块</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="clearfix hidden-xs"></div>
                    <div class="col-sm-12">
                        <!-- Example Checkbox Select -->
                        <div class="example-wrap">

                            <!-- 查询区域 -->
                            <div id="queryModel" tagId="queryTag">
                                <input type="text" v-model="name" placeholder="操作名称"
                                       style="margin-top: 10px"/>&nbsp;
                                <button type="button" class="btn btn-primary btn-sm" @click="queryInfo()">查询</button>&nbsp;
                                <button type="button" class="btn btn-primary btn-sm" @click="exportExcel()">导出excel
                                </button>
                            </div>
                            <!-- 查询区域 end-->


                            <!-- 查询结果表格显示区域 -->
                            <div id="newsContent" class="table-responsive" style="overflow: scroll;" v-cloak>
                                <table class="table table-hover table-bordered text-nowrap">
                                    <tr>

                                        <th>主键</th>
                                        <th>操作名称</th>
                                        <th>操作类</th>
                                        <th>操作方法</th>
                                        <th>创建时间</th>
                                        <th>操作人</th>


                                    </tr>
                                    <tbody id="dataTable">
                                    <tr v-for="data in result">
                                        <td>{{data.id}}</td>
                                        <td>{{data.operName}}</td>
                                        <td>{{data.operClass}}</td>
                                        <td>{{data.operMethod}}</td>
                                        <td>{{data.createTime}}</td>
                                        <td>{{data.createUsername}}</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div id="pageID" class="page_div"></div>
                            </div>
                            <!-- 查询结果表格显示区域 end-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- 全局js -->
    <script src="../../js/jquery.min.js?v=2.1.4"></script>
    <script src="../../js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="../../js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="../../js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="../../js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="../../js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- Peity -->
    <!-- <script src="../../js/demo/bootstrap-table-demo.js"></script> -->
    <script src="../../js/vue/vue.min.js"></script>
    <script src="../../js/util/ajaxFactory.js"></script>
    <script src="../../js/util/crudVueFactory.js"></script>
    <script src="../../js/util/pageMe.js"></script>
    <script src="../../js/config/config.js"></script>
    <script src="../../js/plugins/layer/layer.min.js"></script>
    <script src="../../js/plugins/progressbar/init-mprogress.js"></script>
    <script src="../../js/plugins/progressbar/mprogress.js"></script>
    <script src="../../js/bootstrap-select.min.js"></script>

    <script>
      var currentPage = 1
      var totalPage
      var sqlMap = {}
      //排序的数据
      var orderData = []
      var controllerPrefix = 'operation'
      var methodName = 'likeSelect'

      var queryVue = new Vue({
          el: '#queryModel',
          data: {
            name: ''

          },
          methods: {
            queryInfo: function () {
              sqlMap = {}
              sqlMap.name = this.name
              currentPage = 1
              orderData = []
              $crud.getDataByCurrentPage()
            }
            ,
            exportExcel: function () {

              //显示进度条
              InitMprogress()

              var param = ''

              for (var key in sqlMap) {
                if (sqlMap[key] != '') {
                  param += key + '=' + sqlMap[key] + '&'
                }
              }

              window.location.href = basePath + '/' + controllerPrefix
                + '/exportExcel?' + param
              // 进度条消失
              setTimeout('MprogressEnd()', totalPage / 20 * 1000)
            }
          }

        })

  var tableVue = new Vue({
        el: '#newsContent',
        data: {
          result: []
        },
        //created:
        mounted: function () {
          $crud.getDataByCurrentPage()
        }
      })

  function makeResult (data) {
        for (var i = 0; i < data.length; i++) {
          if (data[i] == null) {
            data[i] = {}
            data[i]['id'] = '无'
            data[i]['operName'] = '无'
            data[i]['operClass'] = '无'
            data[i]['operMethod'] = '无'
          }
        }
      }





    </script>
</div>
</body>
</html>
